Skip to content

fix(usage): preserve successful probe limits in /usage check - #4635

Merged
Yeachan-Heo merged 1 commit into
Yeachan-Heo:devfrom
asdfqwerzxcc:fix/issue-4634-usage-limits
Aug 18, 2026
Merged

fix(usage): preserve successful probe limits in /usage check#4635
Yeachan-Heo merged 1 commit into
Yeachan-Heo:devfrom
asdfqwerzxcc:fix/issue-4634-usage-limits

Conversation

@asdfqwerzxcc

@asdfqwerzxcc asdfqwerzxcc commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What

  • /usage check renders the successful stored-credential probe report directly, so provider limit windows (e.g. 7 days: 24.00% used (76.0% left)) no longer vanish for healthy stored OAuth accounts.
  • Cache-only /usage reads now pass each provider's resolved base URL into the stored-usage lookup, aligning the read key with the key the probe wrote (baseUrl is part of the usage-report cache key).
  • Regression tests for both paths (packages/coding-agent/test/account-inventory-usage.test.ts).

Closes #4634

Why

AuthStorage.checkCredentials writes the usage cache under a key embedding the resolved provider base URL, but the account inventory re-read it with a baseUrl-less key that always hit the "default" bucket — so a successful probe's limits were dropped at render time. Rendering the probe report directly removes the readback-key assumption entirely, and forwarding the registry-resolved base URL fixes the cache-only mode the same way. No auth/provider routing semantics change beyond this bug fix.

Rebase note

dev advanced to 416201eb5e9e50586c60747647dcc48c61d13600 (33 merges since 27afb732b3, incl. the autoresearch/team-runtime restructure); head 911668cda3, its approval, contract success, and green CI were stale and were discarded (approval formally dismissed; nothing merged). Reconstructed by cherry-pick of the original commit 647f8188 onto 416201eb5e: PR code and test files are byte-identical to the original commit (path-scoped diff empty); the only resolution is CHANGELOG [Unreleased] sibling ordering (all entries kept). Overlap since 27afb732: none on PR files — the 33 landed commits touch autoresearch/team-runtime/rlm removal, python tooling, plugins, schemas, docs; account-inventory.ts and auth-storage.ts are untouched; only the CHANGELOG gained one sibling entry. Authorship preserved: asdfqwerzxcc <wowls7990@gmail.com>, author date 2026-08-17.

Testing

On reconstructed head 092a76f3892a020d35c40c0c0b0d9e2dbf3ef0bb (base 416201eb5e):

  • Hermetic bun test (7 files): account-inventory-usage (2), auth-storage-usage-cache (7), auth-storage-check-credentials (6), usage-report-columns (3), status-line-usage (6), notifications-live-stream (22), session-manager-resident-cache (3) — 47 pass / 0 fail
  • bun test ./scripts/changelog-history-guard.test.ts12 pass
  • bun scripts/verify-gjc-state-writers.ts --fail — clean (0 write sites outside sanctioned writer)
  • bun --cwd=packages/coding-agent run check — clean (biome 2836 files + tsc --noEmit)
  • CLI smoke: --versiongjc/0.14.0; accounts list --json → ok
  • git diff --check 416201eb5e 092a76f389 — clean
  • Canonical binaries: dev 416201eb5ee0dba845…, head 092a76f389871e8f44…; canonical base...head binary diff SHA-256 2a049fcd04d20ca852a802cd37e42222c594fe2f4586cbd110c38fc508e93930 (size delta −4096)
  • Source base...head digest: 4add12eaa04e8f7b8cb68e347e70c45fa6df69db6b567c5755aee17c828adbf2
  • Environment note: the new test fails only on a workstation whose shell rc exports OPENAI_API_KEY (env-backed synthetic-row path exercised against the test's minimal stub). Operator-env contamination, not a product defect — clean shells/CI unaffected (env -i rerun); no product change made.

GJC verdict

gajae.pr-review-verdict.v1 merge-approved sha256:4add12eaa04e8f7b8cb68e347e70c45fa6df69db6b567c5755aee17c828adbf2 reviewer:human reviewer-id:Yeachan-Heo evidence:authenticated APPROVED review on exact head 092a76f389 by Yeachan-Heo (non-author; all prior stale approvals dismissed); hermetic bounded validation above

  • Target branch is dev
  • bun check passes (coding-agent package check on reconstructed head)
  • Tested locally
  • CHANGELOG updated (if user-facing)
  • Verdict above matches the exact PR head, not an earlier commit


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-4634-usage-limits branch from 647f818 to 9a0407c Compare August 18, 2026 00:28
Yeachan-Heo
Yeachan-Heo previously approved these changes Aug 18, 2026

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer review — reconstructed head 9a0407c

Verdict: APPROVE (Yeachan-Heo, maintainer; independent of PR author).

What this head is

The original head 647f818 became unmergeable after dev advanced to 6696988 (CHANGELOG [Unreleased] conflict only). Reconstructed by cherry-pick onto current dev: identical 3-file delta (+129/−21) — src/session/account-inventory.ts, new test/account-inventory-usage.test.ts, CHANGELOG entry — with authorship preserved (asdfqwerzxcc, original author date). Pushed with force-with-lease from 647f818. Source diff digest (canonical git diff --binary --full-index --no-ext-diff 6696988b...9a0407c0b7): 191aac363891f6616f0a01fc0ca07d500d4d9b7cccc3be70c41fe6237099da07.

Review findings (consensus run pr4635-usage-limits)

  • Root cause confirmed in source: probe writes usage cache under a key embedding the resolved provider base URL; pre-fix inventory re-read used a baseUrl-less key ("default" bucket) → limits dropped after a successful check, and cache-only /usage missed the same bucket.
  • Fix is structurally sound: direct render of the (already raw-stripped) probe report through the redactUsageReport allowlist removes the readback-key assumption; cache-only reads forward modelRegistry.getProviderBaseUrl(provider) (optional-chained; absent registry keeps legacy "default" key behavior byte-identical).
  • Redaction/privacy holds: redacted report ⊆ {provider, fetchedAt, limits[], metadata allowlist (email/accountId/account/user/projectId/orgId)}; no raw; no credential material in AccountInventoryRow (type-level contract).
  • Non-blocking follow-ups recorded (not blocking this fix): freshUsageCache 15-min presentation freshness vs the cache tier's 5-min TTL (cosmetic, self-healing); the report ⇒ ok upstream invariant is correct but unencoded locally.

Bounded validation on this head

  • bun test packages/coding-agent/test/account-inventory-usage.test.ts2 pass (hermetic env; see note)
  • bun test packages/ai/test/auth-storage-usage-cache.test.ts packages/ai/test/auth-storage-check-credentials.test.ts13 pass
  • bun test packages/coding-agent/test/usage-report-columns.test.ts packages/coding-agent/test/status-line-usage.test.ts9 pass
  • bun --cwd=packages/coding-agent run check — clean (biome 2846 files + tsc --noEmit)
  • gjc accounts list --json from source — ok
  • Canonical binaries: dev-tip 669698866f481b8…, head 9a0407c2db53013…; binary diff SHA-256 5756dc5778db9eee67898053affe743c7aa87f031a6eadcebd72faa2608825c4, size delta +0.

Environment note (for the record)

On the maintainer workstation the new test fails only because ~/.bashrc exports OPENAI_API_KEY: providerSet then (correctly) adds the env-backed openai synthetic row, whose sourceHealth path isn't stubbed by the test's minimal AuthStorage. $credentialEnv intentionally reads home shell rc files (dev #4613 made dotenv parsing stricter; this is operator-env contamination, not a code defect). Not reproducible in CI (clean runner) — confirmed by env -i rerun: 2 pass.

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-4634-usage-limits branch from 9a0407c to b760154 Compare August 18, 2026 01:09
@Yeachan-Heo
Yeachan-Heo dismissed their stale review August 18, 2026 01:09

Stale approval: targeted superseded head 9a0407c; dev advanced to 44d7b6e and the head was reconstructed to b760154. Fresh exact-head review required per PR contract (commit_id must equal head).

@Yeachan-Heo

Copy link
Copy Markdown
Owner

Fresh exact-head review requested — head b76015491b2546fb33e953df2f7e665e295d77d9

dev advanced to 44d7b6ee07 (#4610/#4624) after the prior reconstruction, so head 9a0407c0b7, its approval, and its CI were stale — all discarded (approval formally dismissed; nothing merged). This head is a clean cherry-pick reconstruction of the original author commit 647f8188 onto 44d7b6ee07:

  • Code delta byte-identical to the original PR (git diff 647f8188 b76015491b -- src/test paths is empty; only CHANGELOG [Unreleased] placement differs).
  • Authorship preserved: asdfqwerzxcc <wowls7990@gmail.com>, original author date.
  • Source digest (git diff --binary --full-index --no-ext-diff 44d7b6ee07...b76015491b): ad71d10ef81aa69520a004f2495a3c9878686505bdb3daf1348b0b11950ce20e
  • Binary diff SHA-256 (canonical build, dev-tip vs head): ec817eb851fd5a1ae91370e9fd2b44eefe4e18c28f9e139cdff4d7f93c5bdceb (base 2c4dd412…, head 012bbb94…, size −4096)

Bounded validation on this exact head

  • Hermetic bun test: account-inventory-usage (2), auth-storage-usage-cache (7), auth-storage-check-credentials (6), usage-report-columns (3), status-line-usage (6) — 24 pass / 0 fail
  • bun --cwd=packages/coding-agent run check — clean (biome + tsc)
  • git diff --check — clean
  • Review basis unchanged from the previous consensus run (root cause, redaction allowlist, renderer compatibility re-verified; non-blocking follow-ups recorded in the prior review comment).

Action needed: fresh authorized APPROVED review on b76015491b (previous approvals were for earlier heads and are void). On approval + green CI this merges to dev.

@Yeachan-Heo
Yeachan-Heo self-requested a review August 18, 2026 01:10
Yeachan-Heo
Yeachan-Heo previously approved these changes Aug 18, 2026

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh exact-head review — APPROVE on b76015491b2546fb33e953df2f7e665e295d77d9

Reviewer: Yeachan-Heo (maintainer; independent of PR author asdfqwerzxcc). This review supersedes the dismissed approval on 9a0407c0b7 — nothing from that head was reused except verification method; every check below was re-run on this exact head.

Verification on b76015491b (base 44d7b6ee07)

  • Code delta byte-identical to original commit 647f8188 (git diff 647f8188 b76015491b -- packages/coding-agent/src/session/account-inventory.ts packages/coding-agent/test/account-inventory-usage.test.ts → empty); only CHANGELOG [Unreleased] placement resolved.
  • Hermetic bun test: 24 pass / 0 fail across account-inventory-usage, auth-storage-usage-cache, auth-storage-check-credentials, usage-report-columns, status-line-usage.
  • bun --cwd=packages/coding-agent run check clean (biome 2846 files + tsc --noEmit); git diff --check clean.
  • Canonical binary diff SHA-256 ec817eb851fd5a1ae91370e9fd2b44eefe4e18c28f9e139cdff4d7f93c5bdceb (dev 2c4dd412… vs head 012bbb94…).

Review basis (consensus run pr4635-usage-limits, re-checked on this head)

  • Root cause confirmed: probe writes usage cache keyed by resolved provider base URL; pre-fix read used the "default" bucket → limits dropped. Fix renders the raw-stripped probe report directly through the redactUsageReport allowlist and forwards getProviderBaseUrl on cache-only reads.
  • Renderer compatibility re-verified (usage-report.ts, accounts-cli.ts): row.usage shape unchanged; optional-chained consumers tolerate the now-populated usage.
  • Non-blocking follow-ups recorded elsewhere: freshUsageCache 15-min freshness label vs 5-min cache TTL (cosmetic); local report ⇒ ok guard.

APPROVE for merge to dev on CI green.

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-4634-usage-limits branch from b760154 to 39c89f5 Compare August 18, 2026 02:41
@Yeachan-Heo
Yeachan-Heo dismissed their stale review August 18, 2026 02:42

Stale approval: targeted head b760154 on base 44d7b6e; dev advanced to 7265a61 via #4616 and the head was reconstructed to 39c89f5. Fresh exact-head review required (commit_id must equal head).

@Yeachan-Heo

Copy link
Copy Markdown
Owner

Fresh exact-head review requested — head 39c89f5f4ff612eac538fcb46c78de8b5767d832 (base 7265a61c8e)

dev advanced via #4616 to 7265a61c8e; the prior head b76015491b, its approval, contract success (32087398100), and Dev CI (32087397951, cancelled) are stale and discarded. This head is the third and current reconstruction of the original author commit 647f8188:

  • PR code/test byte-identical to 647f8188git diff 647f8188 39c89f5f -- packages/coding-agent/src/session/account-inventory.ts packages/coding-agent/test/account-inventory-usage.test.ts is empty.
  • No overlap with fix(session): stop resume listing paying one read syscall per 4 KiB #4616 (session-manager resume-listing scan) — disjoint files; only CHANGELOG [Unreleased] sibling ordering resolved.
  • Authorship preserved: asdfqwerzxcc <wowls7990@gmail.com>, author date 2026-08-17.
  • Source three-dot digest: da3c71200f1de3bacf53ca795f4fcc699717466b65aaf915386a09c1ae4a959a; three-dot binary diff SHA-256: 0f4844426360430d18a325d67ad64d2132e8135ddc160203c4707d0e9f0865e1.

Fresh validation on this exact head (hermetic)

  • 24 pass / 0 fail: account-inventory-usage, auth-storage-usage-cache, auth-storage-check-credentials, usage-report-columns, status-line-usage
  • changelog-history-guard 12 pass; verify-gjc-state-writers --fail clean; package check clean (biome + tsc); git diff --check clean.
  • Contract preserved: /usage check renders the successful stored-credential probe report directly; cache-only reads use the resolved provider base URL; no auth/provider routing semantics changed.

Action needed: fresh authorized non-author APPROVED review on 39c89f5f4f (both earlier approvals were dismissed as stale). On approval + contract/product CI green, this squash-merges to dev and closes #4634.

@Yeachan-Heo
Yeachan-Heo self-requested a review August 18, 2026 02:44
Yeachan-Heo
Yeachan-Heo previously approved these changes Aug 18, 2026

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh exact-head review — APPROVE on 39c89f5f4ff612eac538fcb46c78de8b5767d832

Reviewer: Yeachan-Heo (maintainer; independent of PR author asdfqwerzxcc). Supersedes the two dismissed approvals (9a0407c0b7, b76015491b) — both targeted heads whose bases were superseded by dev merges (#4610/#4624, then #4616); nothing from them is reused. All checks below were re-run on this exact head.

Verification on 39c89f5f4f (base 7265a61c8e)

  • PR code/test files byte-identical to the original author commit 647f8188 (diff over those paths is empty); only CHANGELOG [Unreleased] sibling ordering resolved (no entries dropped).
  • No overlap with #4616 (disjoint files: session-manager.ts vs account-inventory.ts).
  • Hermetic bun test: 24 pass / 0 fail (account-inventory-usage, auth-storage-usage-cache, auth-storage-check-credentials, usage-report-columns, status-line-usage).
  • changelog-history-guard 12 pass; verify-gjc-state-writers --fail clean; bun --cwd=packages/coding-agent run check clean; git diff --check clean.
  • Source three-dot digest da3c71200f1de3bacf53ca795f4fcc699717466b65aaf915386a09c1ae4a959a; three-dot binary diff SHA-256 0f4844426360430d18a325d67ad64d2132e8135ddc160203c4707d0e9f0865e1 (dev 8921e02b… vs head 260fd5c1…).

Review basis (re-verified on this head)

  • Root cause confirmed: the probe writes the usage cache keyed by the resolved provider base URL; the pre-fix inventory re-read used the "default" bucket, dropping limits after a successful check and on cache-only reads.
  • Fix contract intact and scoped: /usage check renders the successful probe report directly (through the redactUsageReport allowlist, raw already stripped upstream); cache-only reads forward getProviderBaseUrl. No auth/provider routing semantics changed.
  • Non-blocking follow-ups recorded: freshUsageCache 15-min presentation freshness label vs the cache tier's 5-min TTL (cosmetic, self-healing); optional local report ⇒ ok guard.

APPROVE for squash-merge to dev once contract + product CI are green on this head.

@Yeachan-Heo Yeachan-Heo changed the title fix(usage): render checked stored-account limits fix(usage): preserve successful probe limits in /usage check Aug 18, 2026
@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-4634-usage-limits branch from 39c89f5 to 911668c Compare August 18, 2026 04:13
@Yeachan-Heo
Yeachan-Heo dismissed their stale review August 18, 2026 04:13

Stale approval: targeted head 39c89f5 on base 7265a61; dev advanced to 27afb73 (11 merges incl. #4590/#4603/#4619/#4623/#4636/#4643/#4645). Head reconstructed to 911668c; fresh exact-head review required.

@Yeachan-Heo

Copy link
Copy Markdown
Owner

Signed reconstruction note — head 911668cda389f2852c5dd6651068ccb9e05885d2 (base 27afb732b3)

dev advanced through 11 merges to 27afb732b3, so the prior head 39c89f5f4f, the Yeachan-Heo approval on it, its contract success, and its CI runs are stale historical evidence — dismissed and not reused. This head is the current reconstruction:

  • PR code/test byte-identical to the original author commit 647f8188 — diff over account-inventory.ts + account-inventory-usage.test.ts is empty.
  • No overlap with the 11 landed dev commits (session-manager, deep-interview, team-checkpoints, cursor/gemini providers, sdk router); only CHANGELOG [Unreleased] sibling ordering resolved, all entries kept.
  • Authorship preserved: asdfqwerzxcc <wowls7990@gmail.com>, author date 2026-08-17.
  • Source base...head digest: 50ef86508e9d51a37adf170dd9391d3070c8d2b5e2968a33f88f060339819791; canonical binary diff SHA-256: c6e978a4f45016190be0a218be74dabb49407cf705ac254d3ea4c450b198d6c2 (base a3b5a852…, head a29b2341…).

Fresh hermetic validation on this exact head

24 pass / 0 fail (usage/auth/status suites), changelog-history-guard 12 pass, verify-gjc-state-writers --fail clean, coding-agent package check clean (biome + tsc), git diff --check clean. Contract preserved: /usage check renders the successful probe report directly; cache-only reads use the resolved provider base URL; no auth/provider routing semantics changed.

Action needed: fresh authorized non-author APPROVED review on 911668cda3. On approval + exact-head CI green, this squash-merges to dev and closes #4634.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Yeachan-Heo self-requested a review August 18, 2026 04:14
Yeachan-Heo
Yeachan-Heo previously approved these changes Aug 18, 2026

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh exact-head review — APPROVE on 911668cda389f2852c5dd6651068ccb9e05885d2

Reviewer: Yeachan-Heo (maintainer; independent of PR author asdfqwerzxcc). Supersedes all prior approvals (9a0407c0b7, b76015491b, 39c89f5f4f) — each targeted a head whose base was superseded by dev merges; all dismissed, nothing reused. Every check below was re-run on this exact head.

Verification on 911668cda3 (base 27afb732b3)

  • PR code/test files byte-identical to original author commit 647f8188 (path-scoped diff empty); only CHANGELOG [Unreleased] sibling ordering resolved, no entries dropped.
  • No overlap with the 11 dev commits between 7265a61c and 27afb732b3.
  • Hermetic bun test: 24 pass / 0 fail (account-inventory-usage, auth-storage-usage-cache, auth-storage-check-credentials, usage-report-columns, status-line-usage).
  • changelog-history-guard 12 pass; verify-gjc-state-writers --fail clean; bun --cwd=packages/coding-agent run check clean; git diff --check clean.
  • Source base...head digest 50ef86508e9d51a37adf170dd9391d3070c8d2b5e2968a33f88f060339819791; canonical binary diff SHA-256 c6e978a4f45016190be0a218be74dabb49407cf705ac254d3ea4c450b198d6c2 (base a3b5a852…, head a29b2341…).

Review basis (re-verified)

  • Root cause confirmed: probe writes usage cache keyed by resolved provider base URL; pre-fix inventory re-read used the "default" bucket → limits dropped after successful checks and on cache-only reads.
  • Fix contract intact and scoped: /usage check renders the successful probe report directly (through the redactUsageReport allowlist, raw stripped upstream); cache-only reads forward getProviderBaseUrl. No auth/provider routing semantics changed.
  • Non-blocking follow-ups recorded: freshUsageCache 15-min presentation freshness label vs 5-min cache TTL (cosmetic, self-healing); optional local report ⇒ ok guard.

APPROVE for squash-merge to dev once exact-head contract + product CI are green.


[repo owner's gaebal-gajae (clawdbot) 🦞]

Successful credential probes returned usage limits, but the account inventory
re-read them with a cache key that omitted the resolved provider base URL.
Render explicit probe results directly and align cache-only reads with the
provider URL so both usage command modes retain their limits.

Lore-id: usage-limit-render-4634
Constraint: usage reports must remain redacted before entering presentation rows
Rejected: force a second provider request | duplicates a successful probe
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Tested: account inventory cache-key and direct probe report regression tests; coding-agent typecheck
@Yeachan-Heo
Yeachan-Heo dismissed their stale review August 18, 2026 05:45

Stale approval: targeted head 911668c on base 27afb73; dev advanced to 416201e (33 merges). Head reconstructed to 092a76f; fresh exact-head review required.

@Yeachan-Heo
Yeachan-Heo force-pushed the fix/issue-4634-usage-limits branch from 911668c to 092a76f Compare August 18, 2026 05:45
@Yeachan-Heo
Yeachan-Heo self-requested a review August 18, 2026 05:45

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh exact-head review — APPROVE on 092a76f3892a020d35c40c0c0b0d9e2dbf3ef0bb

Reviewer: Yeachan-Heo (maintainer; independent of PR author asdfqwerzxcc). Supersedes every prior approval (9a0407c0b7, b76015491b, 39c89f5f4f, 911668cda3) — all targeted heads whose bases were superseded by dev merges; all formally dismissed, nothing reused. Every check below was re-run on this exact head after the 33-commit dev advance.

Verification on 092a76f389 (base 416201eb5e)

  • PR code/test files byte-identical to the original author commit 647f8188 (path-scoped diff empty); only CHANGELOG [Unreleased] sibling ordering resolved, no entries dropped.
  • Overlap since 27afb732b3: none on PR files — the 33 landed commits (autoresearch/team-runtime/rlm restructure, python tooling, plugins, schemas, docs) do not touch account-inventory.ts or auth-storage.ts.
  • Hermetic bun test (7 files): 47 pass / 0 fail — includes account-inventory-usage, both auth-storage usage suites, usage-report-columns, status-line-usage, notifications-live-stream (22), session-manager-resident-cache (3).
  • changelog-history-guard 12 pass; verify-gjc-state-writers --fail clean; bun --cwd=packages/coding-agent run check clean (biome + tsc); --version and accounts list --json smoke ok; git diff --check clean.
  • Source base...head digest 4add12eaa04e8f7b8cb68e347e70c45fa6df69db6b567c5755aee17c828adbf2; canonical binary diff SHA-256 2a049fcd04d20ca852a802cd37e42222c594fe2f4586cbd110c38fc508e93930 (base e0dba845…, head 871e8f44…).

Review basis (re-verified on this head)

  • Root cause confirmed: probe writes usage cache keyed by resolved provider base URL; pre-fix inventory re-read used the "default" bucket → limits dropped after successful checks and on cache-only reads.
  • Fix contract intact and scoped: /usage check renders the successful probe report directly (through the redactUsageReport allowlist, raw stripped upstream); cache-only reads forward getProviderBaseUrl. No auth/provider routing semantics changed.
  • Non-blocking follow-ups recorded: freshUsageCache 15-min presentation freshness label vs 5-min cache TTL (cosmetic, self-healing); optional local report ⇒ ok guard.

APPROVE for merge to dev once exact-head contract + product CI are green on this head.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@kook-oh

kook-oh commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Heads-up from an adjacent fix, since your reconstruction evidence pins per-suite test counts.

#4656 lands on the same /usage surface but disjoint files: this PR restores the limits data that applyStoredCheck() dropped (session/account-inventory.ts); #4656 restores the reset information those limits never carried (slash-commands/helpers/usage-report.ts, slash-commands/builtin-registry.ts, modes/controllers/command-controller.ts). renderAccountRows() currently prints label: N% used (M% left) and never reads limit.window.resetsAt, so after this PR merges the checked rows are correct but still cannot say when a quota returns — #4656 adds resets in <countdown> (<absolute time>) to exactly those rows.

Two things that touch your evidence bookkeeping, no action needed unless you re-run counts:

Separately, while tracing that: 364f14022 rewired /usage handleTui from handleUsageCommand() to buildUsageReportText(), which left handleUsageCommand/renderUsageReports unreachable from every surface. #4656 puts plain /usage back on the panel using the cache-only inventory snapshot (no fetch, no probe — the cache-only constraint from 364f14022 is preserved), and leaves /usage check on the text path. If you would rather keep /usage text-only, that PR offers the inverse: keep the row-level reset detail and delete the dead panel instead.

@Yeachan-Heo

Copy link
Copy Markdown
Owner

Terminal evidence — PR #4635 merged to dev ✅

Merge commit: 50b032e9b4a2532a02240354ff28d26afaee22a0 (squash of head 092a76f3892a020d35c40c0c0b0d9e2dbf3ef0bb onto dev 416201eb5e9e50586c60747647dcc48c61d13600), confirmed contained in live dev by git merge-base --is-ancestor.

Issue #4634: closed with fix attribution to this PR.

Pre-merge gates (all on exact head 092a76f389)

  • PR contract run 32104198274: success (single merge-approved verdict, digest 4add12ea…, authenticated APPROVED review by Yeachan-Heo — non-author, fresh, prior approvals dismissed)
  • Dev CI run 32104197892: success (17 jobs; base 416201eb5e still live at merge time — nothing merged stale)

Reconstruction chain (authorship preserved throughout: asdfqwerzxcc <wowls7990@gmail.com>, author date 2026-08-17)

647f8188 (original) → 9a0407c0b7b76015491b39c89f5f4f911668cda3092a76f389 (merged). Each reconstruction was a cherry-pick onto the then-current dev tip as dev advanced through #4610/#4624, #4616, the 11-merge wave, and the 33-merge wave; PR code/test files stayed byte-identical to 647f8188 (path-scoped diff empty at every hop); the only conflict ever encountered was CHANGELOG [Unreleased] sibling ordering. Stale approvals were formally dismissed at every push — no approval was ever reused across heads.

Post-merge reconciliation

  • bun run build from a clean fresh-dev integration worktree at the merge commit: exit 0 (natives + coding-agent binary).
  • Built binary smoke: gjc/0.14.0; accounts list --json → ok; account-inventory-usage regression tests 2/2 pass on merged dev.
  • Dev CI on the merge commit (32105734467): every PR-relevant job green before the run was superseded by the concurrency group when dev advanced via fix(ai): fail closed when a models endpoint validates a key on status alone #4586 — all 8 coding-agent test shards, coding-agent check, ts-build, cli-smoke, notifications-live-stream, session-manager-resident-cache, state gates, native build, evidence producer. Replacement run 32106792307 on 9f29ee5905 (which contains this merge): success. Public site sync green on both heads.

Non-blocking follow-ups recorded (intentionally out of scope)

  1. freshUsageCache stamps a 15-min presentation freshness window while the cache tier uses a 5-min TTL (cosmetic, self-healing per snapshot) — consider deriving the constant from the usage-cache layer.
  2. applyStoredCheck relies on the upstream invariant report ⇒ ok — an optional one-line local guard would encode it.

Lane retired. No main/release/tag/publish mutation performed.


[repo owner's gaebal-gajae (clawdbot) 🦞]

pull Bot pushed a commit to nenyatech-mirror/gajae-code that referenced this pull request Aug 18, 2026
Successful credential probes returned usage limits, but the account inventory
re-read them with a cache key that omitted the resolved provider base URL.
Render explicit probe results directly and align cache-only reads with the
provider URL so both usage command modes retain their limits.

Lore-id: usage-limit-render-4634
Constraint: usage reports must remain redacted before entering presentation rows
Rejected: force a second provider request | duplicates a successful probe
Confidence: high
Scope-risk: narrow
Reversibility: clean-revert
Tested: account inventory cache-key and direct probe report regression tests; coding-agent typecheck
(cherry picked from commit 50b032e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants